﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class WorkTime_WorkTime_YearHoliday : System.Web.UI.Page
{
    private Srvtools.WebDataSet WMaster;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            InitializeComponent();

            Master.DataSource = WMaster;

            MasterPage_MasterPage mpg = (MasterPage_MasterPage)this.Page.Master;
            mpg.HelpHref = "~/Help/WorkTime/带薪假期管理表.htm";
            mpg.PageName = "带薪假期管理表";
            mpg.PicUrl = "";
            mpg.IntiBar();
        }
    }

    private void InitializeComponent()
    {
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WorkTime_WorkTime_YearHoliday));
        this.WMaster = new Srvtools.WebDataSet();
        ((System.ComponentModel.ISupportInitialize)(this.WMaster)).BeginInit();
        // 
        // WMaster
        // 
        this.WMaster.Active = true;
        this.WMaster.AlwaysClose = false;
        this.WMaster.DeleteIncomplete = true;
        this.WMaster.Guid = null;
        this.WMaster.LastKeyValues = null;
        this.WMaster.PacketRecords = 100;
        this.WMaster.Position = -1;
        this.WMaster.RemoteName = "SWorkTime.WorkTime_YearHoliday";
        this.WMaster.ServerModify = true;
        ((System.ComponentModel.ISupportInitialize)(this.WMaster)).EndInit();

    }
    protected void WebNavigator1_Command(object sender, CommandEventArgs e)
    {
        //ClientQuery
        if (e.CommandName == "cmdFirst" || e.CommandName == "cmdPrevious"

       || e.CommandName == "cmdNext" || e.CommandName == "cmdLast")
        {



        }

        else if (e.CommandName == "cmdClientQuery")
        {

            //Detail.ExecuteAdd(wfvMaster);
            ClientQuery.Execute();


        }


    }
    protected void Refresh_Click(object sender, EventArgs e)
    {
        string Sql = "";
        Sql = " (WorkTime_YearHoliday.Years =  " + DlYear.SelectedValue + ") ";

        if (SelUser.EmpName.Length > 0) Sql = Sql + " and (Employees.EmpName like '%" + SelUser.EmpName + "%' ) ";
        if ((DepartmentDList1.SelectDepmanetId.Length > 0) && (DepartmentDList1.SelectDepmanetId != "0")) Sql = Sql + " and (Employees.DepartmentId  Like '" + DepartmentDList1.SelectDepmanetId + "%') ";

        Master.SetWhere(Sql);
        wgvMaster.DataBind();
    }
   
}
